<%--
    Document   : addv030
    Created on : Jul 30, 2012, 3:14:19 PM
    Author     : ems
--%>


<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
<%@taglib prefix="rich" uri="http://richfaces.org/rich" %>
<%@taglib prefix="a4j" uri="http://richfaces.org/a4j" %>

<html>
    <head>
        <link rel="stylesheet" type="text/css" href="../css/popup.css"/>
        <link rel="stylesheet" type="text/css" href="../css/jquery.fancybox-1.3.4.css"/>
        <link rel="stylesheet" type="text/css" href="../css/kapiform.css"/>
        <script type="text/javascript" language="javascript" src="../scripts/jQuery/jquery-1.7.2.min.js"></script>
        <script type="text/javascript" language="javascript" src="../scripts/jQuery/kapi.js"></script>

    </head>
    <script type="text/javascript" language="javascript">
        var open_cur = 0;
        $j = jQuery.noConflict();
        $j(document).ready(function(){
            showGlobalReport();
            swapMenu();
            //            validateform("mapform");
        });
               
    </script>  

    <script type="text/javascript">
        var open_cur = 0;
        $j = jQuery.noConflict();
        $j(document).ready(function(){
            //alert('abc');
            $j(".more_detail_vh").live("click",function(){
                //alert($j(this).parent(".customer-box").find(".popup-footer").attr("class"));
                //alert('aaaaaaaaaaaaaaaa');
                $j(".more_detail_vh_down").css("display","block");
                $j(".more_detail_vh").css("display","none");
                $j(".morevh").css("display","block");
                //                $j(this).parent(".customer-box").css("height","380px");
                //                $j(this).parent(".customer-box").find(".popup-footer").css("margin-top","60px");
            });
            $j(".more_detail_vh_down").live("click",function(){
                //alert($j(this).parent(".customer-box").find(".popup-footer").attr("class"));
                //alert('bbbbbbbbbbb');
                $j(".more_detail_vh").css("display","block");
                $j(".more_detail_vh_down").css("display","none");
                $j(".morevh").css("display","none");
                //                $j(this).parent(".customer-box").css("height","234px");
                //                $j(this).parent(".customer-box").find(".popup-footer").css("margin-top","5px");
            });  
            //            $j('.import').live("click", function(){
            //                alert('aaaaaaaaaaaaaaaaaaaaaaaaaa');
            //                //var tempval = $j(this).attr('lang');
            //                var th = $j(this).parent().next().find('.editor').find('.mceEditor').find('.mceLayout').find('.mceLast').find('.mceIframeContainer > iframe').find('html').find('body');
            //                //alert(th.attr('id'));
            //                $j.post("temp.html",function(data){
            //                    alert(th.html);
            //                    alert(data)
            //                    th.html(data);
            //                    
            //                });
            //                
            //            });
            
            $j(".name_map").live("mouseover",function(){
               
                $j(this).find(".name_map_delete").css("display","block");
                $j(this).find(".keyname").css({"background":"#A0CCF7"," border-radius":"4px","padding":"2px"});
            });
            $j(".name_map").live("mouseout",function(){
                $j(this).find(".name_map_delete").css("display","none");
                $j(this).find(".keyname").css({"background":"none"," border-radius":"none","padding":"0px"});
            });
           
            $j(".name_map_delete").live("click",function(){
                key = $j(this).attr("lang");
                $j.post("mailInput.jsp?action=come_person&key="+key,function(data){
                    if(data != null) {
                        $j("#"+key).remove();
                    }
                });
            });

            $j('.keysearch').live('keyup',function(){
                $j('.rich-table-row').hide();
                $j('.rich-table-row').each(function(){
                    html = $j(this).html();
                    // alert( ununicode(html));  || html.indexOf( $j('.keysearch').val()) > -1
                    if(   html.indexOf( $j('.keysearch').val()) > -1    )  {
                        $j(this).show();
                    }else{
                        $j(this).hide();
                    }

                });
            });
            $j('.disble').attr("disabled",disabled);
            
           
            
            
        });


    </script>
    <style type="text/css">
        .menu-header{
            float:left;
            height:20px;
            width:auto;
            margin-left:20px;
            padding:2px 20px;
            font-weight: bold;
            cursor:pointer;
            background: #2C3945;
            color:white;
        }
        .person{
            overflow: auto;

            border: 1px silver solid;
        }

        label{font-size:12px; text-align: right !important;}
        option{font-size:12px;}
        .rich-inslider-track{width:178px;}

        .menu-header a {
            font-weight: bold;
        }

        .menu-header a:link {
            color: #ffffff;
            text-decoration: none;
        }
        .menu-header a:visited {
            color: #ffffff;
            text-decoration: none;
        }
        .menu-header a:hover {
            color: #ffffff;
            text-decoration: none;
        }
        .menu-header a:active {
            color: #ffffff;
            text-decoration: none;
        }
        .come_person{
            border: 1px solid #EAE9E8;
            float: left;

            margin-top: 4px;
            min-height: 21px;
            padding-left: 14px;
            padding-top: 6px;
            width: 548px;

        }
        .name_map{
            float: left;
            font-size: 12px;
            padding:4px;
            position: relative;
        }
        .name_map .keyname:hover{
            background: none repeat scroll 0 0 #A0CCF7;
            border-radius: 4px;
            padding: 2px;

        }
        .name_map_delete{
            background: url("../images/delete_1.png") repeat scroll 0 0 transparent;
            height: 15px;
            position: absolute;
            right: 0;
            top: 0;
            width: 16px;
            display: none;

        }
        .group_mail{
            float:left;
            width:300px;
        }
        .send_to{
            margin-top:5px ;
        }
        .group_mail_right{
            float: right;
            margin-right: 44px;
            width: 300px;
        }
        .popup-content .main_content .form_item_content {
            float: left;
            height: auto;
            margin-left: 10px;
            margin-top: 21px;
            width: 100%;
        }
        .rich-fileupload-name {
            height: 17px;
            padding: 2px 10px;
            width: 100%;
        }
        .rich-fileupload-toolbar-decor {
            background-color: #FFFFFF;
            padding: 0;
            border:none;
            width: 154px;
            float:left;
        }
        .rich-fileupload-list-decor {
            width: 463px; 
            border:none;
            margin-left: 124px;
            margin-top: 0px;
        }
        .rich-fileupload-name-padding:nth-child(1){
            float:left;
            width:215px !important;
        }
        .rich-fileupload-name-padding{
            float:left;
        }
        .rich-fileupload-name-padding:nth-child(3){
            width:58px !important;
            text-align: right;
            float:left;
        }

        .rich-fileupload-table-td {
            border-bottom: 1px dashed;
            white-space: nowrap;
        }

        .rich-fileupload-list-overflow{
            height:70px  !important ;
            width:406px !important;
            overflow:auto;
            border: 1px solid #C4C0C9;
            margin-left: 154px;
        }

        .rich-fileupload-name {
            height: 3px;
            padding: 0 10px;
            width: 100%;
        }

        .rich-fileupload-button-border{
            float:left !important;
        }
        .errred{
            color: red;
            font-family: arial;
            font-size: 14px;
            margin-left: 255px;
        }
        .disble{

        }
        .changetemp{
            margin-left: 520px;
        }
        .style_blue{
            background: #D1E1F1;
            float: left;
            height: 40px;
            margin-top: 4px;
            width: 100%;
        }
        .style_blue_L{
            background: #D1E1F1;
            float: left;
            height: 34px;
            margin-top: 4px;
            width: 100%;
        }
        .style_nomal{
            width: 100%;
        }

        .morevh{
            display:none;
        }
        .more_detail_vh{
            color: #0C70D3;
            cursor: pointer;
            float: right;
            margin-right: 35px;
            margin-top: -12px;

        }
        .more_detail_vh_down{
            color: #0C70D3;
            cursor: pointer;
            float: right;
            margin-right: 35px;
            margin-top: -12px;
            display: none;
        }
    </style>
    <f:view>
        <h:panelGroup rendered="#{loginSession.login.showGlobalMessage}">
            <center style="width: 100%">
                <div id="globalReport" class="globalReport">
                    <p style="padding-top: -5px;"><h:outputText value="#{loginSession.login.globalMessage}"/></p>
                </div>
            </center>
        </h:panelGroup>
        <a4j:form id="mapform">
            <body style=" float:left; width:auto; height:auto; margin:0px;overflow: hidden;">
                <f:loadBundle basename="#{environmentSession.localizationSource}" var="locale"/>

                <div class="popup" style="height:510px; width:760px;background:white;margin-top:13px; margin-right: 12px ">
                    <div class="popup-header">
                        <div class="title"><h:outputText value="#{locale.send_mail}" style="text-transform:uppercase"/></div>
                        <div style=" position: fixed; float:left; height:50px;width:50px;left:708px;">
                            <a id="fancybox-close" onclick="self.parent.tb_remove()"  style="display: block; float:left;"></a>
                            <%--                            <a class="fancybox-close" onclick="self.parent.location='customer4tour.jsp?action=clear'" <h:outputText rendered="#{m575Bean.s != 'customer4tour'}" value="style='display:none'" /> style="display: block; float:left;" ></a>
                                                        <a class="fancybox-close" onclick="self.parent.location='customerexpand.jsp?action=clear'" <h:outputText rendered="#{m575Bean.s != 'customerexpand'}" value="style='display:none'" /> style="display: block; float:left;"></a>--%>
                        </div>
                    </div>
                    <div class="popup-content">
                        <div class="main_content" style="height:402px;">
                            <div class="form_item_content" style="margin-top:5px;margin-left: -1px;">
                                <div class="style_nomal">
                                    <div class="fields_input">
                                        <label><h:outputText value="#{locale.title}"/>*:</label>
                                        <h:inputText value="#{m575Bean.subjectMail}" styleClass="required" style="width:557px;height:20px;"/>

                                    </div> 
                                </div>       
                                <div class="style_blue"> 
                                    <p style="position:absolute; float:left; margin-left:72px;font-size: 12px;margin-top:6px;">Gửi :</p>
                                    <div class="fields_input" >
                                        <h:inputText value="#{m575Bean.listInfoTo}" style="margin-left:123px;width:557px;height:20px;"/>
                                    </div>    
                                </div>
                                <div class="style_nomal">
                                    <p style="position:absolute; float:left; margin-left:63px;font-size: 12px;margin-top:88px;">Gửi CC :</p>
                                    <div class="fields_input" >
                                        <h:inputText value="#{m575Bean.listInfo}"  styleClass=" required disble" style="margin-left:123px;width:557px;height:20px;"/>
                                    </div>
                                </div>

                                <div class="more_detail_vh"><img src="../images/up.png" alt=""/></div>
                                <div class="more_detail_vh_down"><img src="../images/down.png" alt=""/></div>
                                <div class="morevh">
                                    <div class="fields_input">
                                        <p style="position:absolute; float:left; margin-left:60px;font-size: 12px;margin-top:0px;"> Đính kèm :</p>
                                        <rich:fileUpload maxFilesQuantity="10"  
                                                         fileUploadListener="#{m575Bean.listener}" 
                                                         allowFlash="true"
                                                         uploadControlLabel="Tải lên"
                                                         addControlLabel="Thêm"
                                                         clearAllControlLabel="Xóa hết"
                                                         clearControlLabel="Hủy"
                                                         cancelEntryControlLabel="Hủy"
                                                         />
                                    </div>
                                </div>
                                <%--<div class="style_nomal">
                                    <div class="fields_input">
                                        <p style="position:absolute; float:left; margin-left:60px;font-size: 12px;margin-top:0px;"> Đính kèm :</p>
                                        <rich:fileUpload maxFilesQuantity="10"  
                                                        fileUploadListener="#{m575Bean.listener}" 
                                                        allowFlash="true"
                                                        uploadControlLabel="Tải lên"
                                                        addControlLabel="Thêm"
                                                        clearAllControlLabel="Xóa hết"
                                                        clearControlLabel="Hủy"
                                                        cancelEntryControlLabel="Hủy"
                                                        />
                                    </div>
                                </div>  --%>  
                                <div class="style_blue_L"> 
                                    <p style="position:absolute; float:left; margin-left:55px;font-size: 12px;margin-top:10px;"> Mẫu email :</p>
                                    <div class="fields_input changetemp">
                                        <%--<h:selectOneMenu  id="codeTour" value="#{m575Bean.filetemp}" styleClass="temp">
                                            <f:selectItems value="#{m575Bean.listcomboM200}" />
                                        </h:selectOneMenu>--%>
                                        <a4j:region>

                                            <h:selectOneMenu value="#{m575Bean.pm200}" id="ldv"  styleClass="select_tour fs200" >

                                                <f:selectItems value="#{m575Bean.listcomboM200}" />
                                                <a4j:support event="onchange"
                                                             actionListener="#{m575Bean.change4ldv}" reRender="content" />
                                            </h:selectOneMenu>
                                        </a4j:region>
                                    </div>
                                </div>
                                <div class="style_blue_L" style="margin-top: 0px;"> 
                                    <p style="position:absolute; float:left; margin-left:55px;font-size: 12px;margin-top:10px;"> Email gửi đi:</p>

                                    <div class="fields_input changetemp">
                                        <h:panelGroup id="abcd">
                                            <h:panelGroup  rendered="#{! m575Bean.checkN850}">
                                                <a4j:region>
                                                    <h:selectOneMenu value="#{m575Bean.mailsendId}" >
                                                        <f:selectItems value="#{m575Bean.listcomboQ000}" />                                               
                                                    </h:selectOneMenu>
                                                </a4j:region>
                                            </h:panelGroup>
                                            <h:panelGroup rendered="#{m575Bean.checkN850}">
                                                <h:selectOneMenu value="#{m575Bean.mailsendId}">
                                                    <f:selectItems value="#{m575Bean.listcomboM250}" />     

                                                </h:selectOneMenu>
                                            </h:panelGroup>
                                        </h:panelGroup>
                                        <a4j:region>

                                            <h:selectBooleanCheckbox value="#{m575Bean.checkN850}" style="margin-left:10px;" >

                                                <a4j:support event="onchange"
                                                             actionListener="#{m575Bean.changen850}" reRender="abcd,listmail" />
                                            </h:selectBooleanCheckbox>

                                        </a4j:region>

                                    </div>
                                </div>
                                <div class="fields_input">
                                    <label><h:outputText value="#{locale.content}" styleClass=""/>:</label>
                                    <rich:editor viewMode="visual"
                                                 theme="advanced"
                                                 value="#{m575Bean.contentMail}" height="200" width="564" styleClass="editor" id="content">
                                        <jsp:include page="../../common/EditorComponent.jsp"></jsp:include>

                                    </rich:editor>

                                </div>


                            </div>
                        </div>

                    </div>


                    <div class="popup-footer" style="margin-top:60px;">


                        <h:outputText styleClass="errred"  value="Thao tác của bạn không thành công !" rendered="#{m575Bean.chkMess}"></h:outputText>           
                        <h:outputText styleClass="errred"  value="Thư của bạn đã được gửi!" rendered="#{m575Bean.chkMessS}"></h:outputText>    
                        <h:panelGroup rendered="#{m575Bean.stephide == 1}"><div class="buttonsave" onclick="self.parent.location='cuscompany.jsp?tab=tab2<h:outputText value="#{m575Bean.fb050}"/>&flag=<h:outputText value="#{m575Bean.timezone}"/>&#<h:outputText value="#{m575Bean.fb050}"/>'" /> <span><h:outputText value="#{locale.close}"/></span></div></h:panelGroup>
                    <h:panelGroup rendered="#{m575Bean.stephide == 2}"><div class="buttonsave" onclick="self.parent.location='cuscompany.jsp?tab=tab3<h:outputText value="#{m575Bean.fb050}"/>&flag=<h:outputText value="#{m575Bean.timezone}"/>&#<h:outputText value="#{m575Bean.fb050}"/>'" /> <span><h:outputText value="#{locale.close}"/></span></div></h:panelGroup>

                <h:panelGroup rendered="#{m575Bean.stephide != 1 && m575Bean.stephide != 2}"><div class="buttonsave" onclick="self.parent.location='customer4tour.jsp?action=clear'" <h:outputText rendered="#{m575Bean.s != 'customer4tour'}" value="style='display:none'" /> ><span><h:outputText value="#{locale.close}"/></span></div></h:panelGroup>
                <h:panelGroup rendered="#{m575Bean.stephide != 1 && m575Bean.stephide != 2}"><div class="buttonsave" onclick="self.parent.location='customerexpand.jsp?action=clear'" <h:outputText rendered="#{m575Bean.s != 'customerexpand'}" value="style='display:none'" /> ><span><h:outputText value="#{locale.close}"/></span></div></h:panelGroup>
                <h:panelGroup rendered="#{m575Bean.stephide != 1 && m575Bean.stephide != 2}"><div class="buttonsave" onclick="self.parent.location='workChargeCM.jsp?action=clear'" <h:outputText rendered="#{m575Bean.s != 'workChargeCM'}" value="style='display:none'" /> ><span><h:outputText value="#{locale.close}"/></span></div></h:panelGroup>
                <h:panelGroup rendered="#{m575Bean.stephide != 1 && m575Bean.stephide != 2}"><div class="buttonsave" onclick="self.parent.location='workChargeCOM.jsp?action=clear'" <h:outputText rendered="#{m575Bean.s != 'workChargeCOM'}" value="style='display:none'" /> ><span><h:outputText value="#{locale.close}"/></span></div></h:panelGroup>
                <h:commandButton onclick="showPleaseWait();"  action="#{m575Bean.sendEmailrepo}" value="Gửi" styleClass="buttonsave">

                </h:commandButton>
                <%--<h:commandButton onclick="showPleaseWait();"  action="#{m575Bean.check}" value="getlistMail" styleClass="buttonsave">

                        </h:commandButton>--%>
                <rich:modalPanel id="ajaxLoadingModalBox" minHeight="30" minWidth="40"
                                 height="30" width="40" zindex="2000">
                    <h:outputText value="#{locale.please_wait}" styleClass="startDummer"></h:outputText>
                </rich:modalPanel>

            </div>

        </div>
        <h:inputHidden value="#{m575Bean.mv577}" id="mv577"/>
        <h:inputHidden value="#{m575Bean.fm575repo}" id="fm575re"/>
        <h:inputHidden value="#{m575Bean.stephide}" id="step"/>
        <h:inputHidden value="#{m575Bean.fb050}" id="fb050"/>
        <h:inputHidden value="#{m575Bean.fq100repo}" id="fq100"/>
    </body>
</a4j:form>

</f:view>
</html>
<script type="text/javascript" language="javascript">
    var open_cur = 0;
    $j = jQuery.noConflict();
    $j(document).ready(function(){
            
           
    });
               
</script>

